Next | Prev | Up | Top | Contents | Index
Separable and General Convolution Filters
A convolution that uses separable filters operates faster than one that uses general filters.
Special facilities are provided for the definition of two-dimensional separable filters. For separable filters, the image is represented as the product of two one-dimensional images, not as a full two-dimensional image.
To specify a two-dimensional separable filter, call glSeparableFilter2DEXT().
- target must be GL_SEPARABLE_2D_EXT.
- internalformat specifies the formats of two one-dimensional images that are retained; it must be one of GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_INTENSITY_EXT, GL_RGB, or GL_RGBA.
- row and column point to two one-dimensional images in memory.
- The row image, defined by format and type, is width pixels wide.
- The column image, defined by format and type, is height pixels wide.
The two images are extracted from memory and processed just as if glConvolutionFilter1DEXT() were called separately for each, with the resulting retained images replacing the current 2D separable filter images, except that each scale and bias are applied to each image using the 2D separable scale and bias vectors.
If you're using convolution on a texture image, keep in mind that the result of the convolution must obey the constraint that the dimensions have to be a power of 2. If you use the reduce border convolution mode, the image shrinks by the filter width minus 1, so you may have to take that into account ahead of time.
Next | Prev | Up | Top | Contents | Index